package com.wunu.smartlock1.adapter;

/**
 * Created by admin on 2018/4/22.
 */
import android.app.Activity;
import android.app.Dialog;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import com.wunu.smartlock1.R;

public class SelectPicPopupWindow  extends  PopupWindow{
    View mMenuView;
    TextView cancelView;
    TextView resetView;
    Dialog dialog;
    View inflate;
    public SelectPicPopupWindow(Activity context,OnClickListener itemsOnClick) {
        super(context);
        dialog = new Dialog(context,R.style.smartlock_ActionSheetDialogStyle);
        inflate = LayoutInflater.from(context).inflate(R.layout.smartlock_buttom_dialog, null);

        cancelView = dialog.findViewById(R.id.resetlock);//取消弹框
        cancelView.setOnClickListener(new OnClickListener(){
            public void onClick(View v) {
                //销毁弹出框

            }
        });
        dialog.setContentView(inflate);
        Window dialogWindow = dialog.getWindow();
        dialogWindow.setGravity( Gravity.BOTTOM);
        WindowManager.LayoutParams lp = dialogWindow.getAttributes();
        lp.y = 20;
        dialogWindow.setAttributes(lp);
        dialog.show();
    }
}
